Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(visualizer): update block colors #1193

Merged
merged 6 commits into from
Feb 28, 2024

Conversation

VmMad
Copy link
Member

@VmMad VmMad commented Feb 27, 2024

Description of change

Fixes #1181

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Describe the tests that you ran to verify your changes.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • My code follows the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@VmMad VmMad linked an issue Feb 27, 2024 that may be closed by this pull request
@VmMad VmMad requested review from panteleymonchuk, msarcev and begonaalvarezd and removed request for msarcev February 27, 2024 18:07
@@ -43,7 +43,7 @@ import StardustSearch from "./routes/stardust/Search";
import StardustStatisticsPage from "./routes/stardust/statistics/StatisticsPage";
import StardustTransactionPage from "./routes/stardust/TransactionPage";
import { Visualizer as StardustVisualizer } from "./routes/stardust/Visualizer";
import NovaVisualizer from "../features/visualizer-threejs/VisualizerInstance";
import NovaVisualizerWrapper from "../features/visualizer-threejs/NovaVisualizerWrapper";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use NovaVisualizer name instead of NovaVisualizerWrapper?
Seems it could be more convenient according to names on this page.

Could we create in folder features/visualizer-threejs file like index.ts and make all exports from this file? It will look like all what exported from index.ts is like public. What not exported only for internal using.

And maybe we could rename
NovaVisualizerWrapper.tsx → NovaVisualizer.tsx

In file client/src/features/visualizer-threejs/NovaVisualizerWrapper.tsx
from import NovaVisualizer from "./VisualizerInstance";
to import VisualizerInstance from "./VisualizerInstance";

Not requirement, just discussion.
What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the file name and made a new task for the store refactor:
#1196

Comment on lines +84 to +85
blockIdToState: Map<BlockId, BlockState>;
setBlockIdToBlockState: (blockId: BlockId, blockState: BlockState) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we have a lot of data that related to blockId.
And usually when we need to remove block, we need to go through all maps, like:
blockIdToIndex, blockIdToEdges, blockIdToPosition, blockMetadata, blockIdToAnimationPosition, blockIdToState.

Maybe it's a good sign to:

  1. Store all of this mappers one under another.
blockIdToIndex: Map<string, number>;
blockIdToEdges: Map<string, EdgeEntry>;
blockIdToPosition: Map<string, [x: number, y: number, z: number]>;
blockIdToMetadata: Map<string, IFeedBlockData & { treeColor: Color }>; // rename it from blockMetadata
blockIdToAnimationPosition: Map<string, IBlockAnimationPosition>;
blockIdToState: Map<BlockId, BlockState>;
  1. Create function for clear all dependent mapper's data at once.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a new issue for this:
#1196

Comment on lines +222 to +223
const previousBlockId = state.indexToBlockId[index];
if (previousBlockId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see. Maybe this is something that I was talking about in comment above.

@panteleymonchuk panteleymonchuk self-requested a review February 28, 2024 11:04
@begonaalvarezd begonaalvarezd merged commit e895097 into dev Feb 28, 2024
4 of 6 checks passed
@begonaalvarezd begonaalvarezd deleted the feat/nova-visualizer/update-block-colors branch February 28, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Update visualizer colors
3 participants